Skip to content

Enforce the Windows SDK top-level bin contract - #192

Open
devnoname120 wants to merge 2 commits into
vitasdk:masterfrom
devnoname120:fix/windows-bin-contract
Open

devnoname120 wants to merge 2 commits into
vitasdk:masterfrom
devnoname120:fix/windows-bin-contract

Conversation

@devnoname120

@devnoname120 devnoname120 commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Enforce the Windows SDK's regular top-level bin/ contract during both staged SDK validation and core-package validation.

A regular file directly under Windows bin/ is accepted only when it is:

  • a PE host executable according to the existing host-binary-format classifier;
  • makepkg.conf;
  • vita-makepkg (currently requires an external MSYS2 environment);
  • vitasdk-update (the legacy compatibility updater; vdpm is the current native path);
  • arm-vita-eabi-gdb-add-index (the upstream GNU GDB POSIX helper retained unchanged for compatibility).

Every other non-PE regular top-level file is rejected with a diagnostic containing its path. Directories such as bin/libmakepkg/ remain outside this rule.

The staged-tree and package paths call the same CMake policy function, so their allowlists cannot drift. Non-Windows validation is unchanged.

Dependency and landing order

This PR intentionally targets master, but it must land after:

The previous Windows pkg-config shell frontend would violate this contract. I tested the policy in a detached overlay containing the current #190 head. After #190 lands, this branch should be rebased and #190's newly-added synthetic Windows executable fixtures should retain PE MZ magic; no production-code incompatibility was found. Neither prerequisite branch was modified.

Until those prerequisites land, a current-master Windows SDK leg may fail when the new policy encounters the old non-PE arm-vita-eabi-pkg-config shell wrapper. That is the intended dependency signal; the obsolete wrapper should not be added to this allowlist.

Verification

Standalone branch:

  • every tests/cmake/*.cmake script passed;
  • all protocol tests passed;
  • all CI shell tests passed;
  • all package tests passed using the repository's minimal stage-1 fixture, including Docker installation coverage;
  • the PowerShell bootstrap smoke contract passed through a PowerShell container;
  • Bash syntax checks and git diff --check passed;
  • the new shell test passes ShellCheck (the validator still has one pre-existing unused-variable warning outside this change).

Integrated with current #190:

  • every CMake script, including pkgconf and Windows-bin validation, passed;
  • all protocol and CI shell tests passed;
  • all package tests passed;
  • the PowerShell smoke contract passed.

New tests cover every explicit exception, PE acceptance, nested directories, rejection of an unknown script, rejection of unknown data, staged validation, package validation, path-bearing diagnostics, and unchanged Linux behavior.

Keep the Windows top-level bin policy while incorporating the pkgconf and vdpm updates now on master. Update the new Windows SDK fixtures so every simulated host executable satisfies the PE contract.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant